package org.jeecg.modules.putil.wx;

import lombok.Getter;

@Getter
public enum WxAbilityEnum {

    GET_CODE_UNLIMITED("https://api.weixin.qq.com/wxa/getwxacodeunlimit?access_token=YOUR_TK", "获取微信小程序码"),
    DO_MSG_SEC_CHECK("https://api.weixin.qq.com/wxa/msg_sec_check?access_token=YOUR_TK", "敏感词汇校验"),
    SEND_WX_NOTIFY("https://api.weixin.qq.com/cgi-bin/message/subscribe/bizsend?access_token=YOUR_TK", "发送公众号消息");

    WxAbilityEnum(String url, String name) {
        this.url = url;
        this.name = name;
    }

    private final String url;
    private final String name;

    /**
     * 获取可以访问的url
     *
     * @param wxToken 允许访问的token
     */
    public String getUrl(String wxToken) {
        return this.url.replace("YOUR_TK", wxToken);
    }

}
